import Router from 'koa-router';
import PublicController from '../api/publicController';
import ContentController from '../api/contentController';
import UserController from '../api/userController';
const router = new Router();

router.prefix('/public'); // 加路由前缀

router.post('/user', PublicController.user);

router.get('/getCaptcha', PublicController.getCaptcha);

router.get('/list', ContentController.getPostList);

router.get('/links', ContentController.getLinksList);

router.get('/tips', ContentController.getTipsList);

router.get('/topWeek', ContentController.getHotList);

router.get('/top', ContentController.getTopList);

router.get('/email', UserController.updateUserEmail);

router.get('/api', (ctx) => {
  ctx.body = 'hello api';
});

export default router;
